package com.weixing.mall.provider.controller;

import com.weixing.mall.base.wrapper.Result;
import com.weixing.mall.base.wrapper.ResultUtil;
import com.weixing.mall.core.support.BaseController;
import com.weixing.mall.provider.spuuort.wechat.AccessTokenLoader;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.concurrent.TimeUnit;

/**
 * @Author: kfc
 * @Description: <br/>
 * Date:Create in 2019/9/6 16:56
 * @Modified By:
 */
@Validated
@RestController
@RequestMapping("wx")
public class TestWeiXinController extends BaseController {


    @Autowired
    private StringRedisTemplate stringRedisTemplate;
    @Autowired
    private AccessTokenLoader accessTokenLoader;

    @GetMapping("test")
    public Result checkMobile() {
        stringRedisTemplate.opsForValue().set("test","test",10, TimeUnit.MINUTES);


        String test = stringRedisTemplate.opsForValue().get("test");


        System.out.println(test);


        accessTokenLoader.get();

        return  ResultUtil.success();
    }


}
